﻿Public Sub ReplaceMainKeywords()
    '
    ' modify using statements.
    '
    MySearchReplace("using Microsoft.Crm.Sdk;", "using Microsoft.Xrm.Sdk;", True, False)
    MySearchReplace("using Microsoft.Crm.Sdk.Metadata;", "Microsoft.Xrm.Sdk.Metadata;", True, False)
    MySearchReplace("using Microsoft.Crm.Sdk.Metadata.Query;", "using Microsoft.Xrm.Sdk.Metadata.Query;", True, False)
    MySearchReplace("using Microsoft.Crm.Sdk.Query;", "using Microsoft.Xrm.Sdk.Query;", True, False)
    MySearchReplace("using Microsoft.Crm.SdkTypeProxy;", "using Microsoft.Xrm.Sdk.Messages;", True, False)
    MySearchReplace("using Microsoft.Crm.SdkTypeProxy.Metadata;", "//using Microsoft.Crm.SdkTypeProxy.Metadata;", True, False)

    'MySearchReplace("", "", True, False)

    MySearchReplace("ICrmService", "IOrganizationService", True, False)
    MySearchReplace("CrmService", "OrganizationService", True, False)
    MySearchReplace("ReturnDynamicEntities = true", "", True, False)
    MySearchReplace("BusinessEntityCollection", "EntityCollection", True, False)
    MySearchReplace("BusinessEntity", "Entity", True, False)
    MySearchReplace("DynamicEntity", "Entity", True, False)
    MySearchReplace(".BusinessEntities", ".Entities", True, False)
    MySearchReplace(".Entities.Length", ".Entities.Count", True, False)
    MySearchReplace("AllColumns()", "ColumnSet(true)", True, False)
    MySearchReplace(".Properties.", ".Attributes.", True, False)
    MySearchReplace(".Properties[", ".Attributes[", True, False)

    '
    ' The following are customer-specific an will probably be removed in a future release
    '
    MySearchReplace("statecode.formattedvalue", "FormattedValues[""statuscode""]", True, False)
    MySearchReplace("ownerid", "OwnerId", True, False)
    MySearchReplace(".name", ".Name", True, False)
    MySearchReplace("Accountid.Value", "AccountId", True, False)
    MySearchReplace("activityparty", "ActivityParty", True, False)
    MySearchReplace("partyid", "PartyId", True, False)
    MySearchReplace(".productnumber", ".ProductNumber", True, False)
    MySearchReplace(".relationshiprole", ".RelationshipRole", True, False)
End Sub